@extends('admin.layout-adm')
@section('title','创建新专家')
@section('content')

        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" >
            <div class="col-md-12" id="content" >

                <div class="app_content_div" id="app_content_div_301Index">
                    <h3>新增专家</h3>
                </div>

                <form class="form-horizontal"  method="post" action="/adm/expert/add">
                    @csrf
                    <input type="hidden" name="_token" id="_token" value="n5zFXfLqkXJfOd030qivQpDIUaD54lOXf8miR6U9" />
                    <div class="form-group">
                        <label for="doc_name" class="col-sm-2 control-label"><span style="color:red;">*</span>姓名</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="name" name="name" >
                        </div>
                    </div>


{{--                    <div class="form-group">--}}
{{--                        <label for="upload_file" class="col-sm-2 control-label"><span style="color:red;">*</span>缩略图</label>--}}
{{--                        <div class="col-sm-10">--}}
{{--                            <img style="width:160px;height:200px;" alt="" id="thumb" src=""/>--}}
{{--                        </div>--}}
{{--                    </div>--}}


                    <div class="form-group">
                        <label for="doc_position" class="col-sm-2 control-label"><span style="color:red;">*</span>科室</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="ks" name="ks" >
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="doc_department" class="col-sm-2 control-label"><span style="color:red;">*</span>职称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id=“zc" name="zc" >
                        </div>
                    </div>


{{--                    <div class="form-group">--}}
{{--                        <label for="doc_department" class="col-sm-2 control-label"><span style="color:red;">*</span>职务</label>--}}
{{--                        <div class="col-sm-10">--}}
{{--                            <input type="text" class="form-control" id=“zy" name="zy" >--}}
{{--                        </div>--}}
{{--                    </div>--}}


                    <div class="form-group">
                        <label for="doc_department" class="col-sm-2 control-label"><span style="color:red;">*</span>医院</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id=“yy" name="yy" >
                        </div>
                    </div>


{{--                    <div class="form-group" >--}}
{{--                        <label for="doc_introduction" class="col-sm-2 control-label"><span style="color:red;">*</span>简介</label>--}}
{{--                        <div class="col-sm-10">--}}
{{--                            <script id="description" name="description" type="text/plain"></script>--}}
{{--                            <script type="text/javascript">--}}
{{--                                var editor = UE.getEditor('description')--}}
{{--                            </script>--}}
{{--                        </div>--}}
{{--                    </div>--}}


{{--                    <div class="form-group" >--}}
{{--                        <label for="doc_introduction" class="col-sm-2 control-label"><span style="color:red;">*</span>接受教育</label>--}}
{{--                        <div class="col-sm-10">--}}
{{--                            <script id="education" name="education" type="text/plain"></script>--}}
{{--                            <script type="text/javascript">--}}
{{--                                var editor = UE.getEditor('education')--}}
{{--                            </script>--}}
{{--                        </div>--}}
{{--                    </div>--}}


                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <input type="button" name="dosubmit" value="确定" onclick="check()">
                        </div>
                    </div>


                </form>
            </div>
        </div>

        <script>
            function check(){
                var name=$("#name").val();
                var ks=$("#ks").val();
                var zc=$("#zc").val();
                var yy=$("#yy").val();
                var _token="{{csrf_token()}}";
                $.post('/adm/expert/add',
                    {'name':name,'ks':ks,'zc':zc,'yy':yy,'_token':_token},
                    function (data){
                        if(data.success){
                            alert("新专家已成功创建");
                            location.href='/adm/expert';
                        }
                        else{
                            alert(data.msg);
                        }
                    },'json')
            }
        </script>
@endsection
